#include "main/utils.h"
using namespace std;

class Solution {
public:
    void permute(vector<int>& nums, vector<vector<int>>& output, int idx) {
      if (idx == nums.size() - 1) {
        output.push_back(nums);
      }
      for (int i = idx; i < nums.size(); ++i) {
        swap(nums[i], nums[idx]);
        permute(nums, output, idx + 1);
        swap(nums[i], nums[idx]);
      }
    }

    vector<vector<int>> permute(vector<int>& nums) {
      vector<vector<int>> output;
      permute(nums, output, 0);
      return output;
    }
};

int main() {
  vector<int> input = {1, 2, 3};
  Solution su;
  auto output = su.permute(input);
  printVec("output", output);
}
